home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Pict Tricks / Batch CLUTLess / Shell Files / init.c < prev    next >
Encoding:
Text File  |  1994-10-14  |  1.5 KB  |  61 lines  |  [TEXT/MMCC]

  1. //---------------------------------------------------------------------
  2. //---------------------------------------------------------------------
  3. //
  4. //    Horrible Rickety Shell, by Dave Johnson
  5. //
  6. //    © Copyright 1985 - 1994 Anyone Who Wants It,
  7. //    All Rights Energetically Heaved as far away from me as possible.
  8. //    Use at your own (considerable) risk.
  9.  
  10.  
  11. # include    "Shell.h"
  12.  
  13. extern Rect                gDeskRect;
  14. extern MenuHandle        gShellMenuHandles[];
  15.  
  16. /*-------------------------------------------------------------------------
  17. initshell()            Inits all the application-specific variables...
  18. -------------------------------------------------------------------------*/
  19.  
  20. void initshell()
  21. {
  22.     MenuHandle        mhndl;
  23.     unsigned long    seed;
  24.     
  25.     /* Get Bounding box of Desktop  */
  26.     gDeskRect = (**GetGrayRgn()).rgnBBox;
  27.     
  28.     /* Reset random number generator  */
  29.     GetDateTime(&seed);
  30.     qd.randSeed = seed;
  31.  
  32.     /* Read in menus, draw the bar... */
  33.     mhndl = GetMenu(kAppleMenuID);
  34.     if(mhndl == nil)
  35.         BailOut();
  36.     AddResMenu(mhndl, 'DRVR');
  37.     (*mhndl)->menuID = kAppleMenuID;
  38.     InsertMenu(mhndl, 0);
  39.     gShellMenuHandles[kAppleMenu] = mhndl;
  40.     
  41.     mhndl = GetMenu(kFileMenuID);
  42.     if(mhndl == nil)
  43.         BailOut();
  44.     (*mhndl)->menuID = kFileMenuID;
  45.     InsertMenu(mhndl, 0);
  46.     gShellMenuHandles[kFileMenu] = mhndl;
  47.     
  48.     mhndl = GetMenu(kEditMenuID);
  49.     if(mhndl == nil)
  50.         BailOut();
  51.     (*mhndl)->menuID = kEditMenuID;
  52.     InsertMenu(mhndl, 0);
  53.     gShellMenuHandles[kEditMenu] = mhndl;
  54.  
  55.     DrawMenuBar();
  56.     
  57.     /* Init the App's stuff */
  58.     if(!AppInit())
  59.         BailOut();
  60. }
  61.